package Clases;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Cédric
 */

import java.io.*;

public class LeeFich {
        String nom_fich;
        private String linea;
        public LeeFich(String nombre){
            nom_fich=nombre;
        }
	public String ExtraeVideo(){
		String cadena="";
		String fichero =nom_fich;

		//Lectura del fichero
		try{
			InputStream ips=new FileInputStream(fichero);
			InputStreamReader ipsr=new InputStreamReader(ips);
			BufferedReader br=new BufferedReader(ipsr);
			//String linea;
                        linea=br.readLine();
			/*while ((linea=br.readLine())!=null){
				System.out.println(linea);
				cadena+=linea+"\n";
			}*/
			br.close();
		}
		catch (Exception e){
			System.out.println(e.toString());
		}
/*
		//Creación o añadir a fichero
		try {
			FileWriter fw = new FileWriter (fichero);
			BufferedWriter bw = new BufferedWriter (fw);
			PrintWriter ficheroSalida = new PrintWriter (bw);
				ficheroSalida.println (cadena+"\n test de lectura/escritura !!");
			ficheroSalida.close();
			System.out.println("El fichero " + fichero + " ha sido creado!");
		}
		catch (Exception e){
			System.out.println(e.toString());
		}*/
                return linea;
	}
}
